{include file="app/admin/view/header.html"}
<link rel="stylesheet" href="*ADMIN*/css/set.css">
<style type="text/css" media="all">
.layui-card-body, .layui-card-header, .layui-form-label, .layui-form-mid, .layui-form-select, .layui-input-block, .layui-input-inline, .layui-textarea {
    position: initial;
}
.addonsfuzhi {
    border: 1px solid #fff7f7;
    color: #eee;
}
.layui-form-select .layui-edge {
    margin-top: 10px;
}
.layui-form-selected .layui-edge {
    margin-top: 3px;
}
blockquote {
    display: block;
    border-left: 8px solid #0dc316;
    padding: 5px 10px;
    font-size: 100%;
    background-color: #f8f8f8;
    color: #0dc316;
}
</style>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <!--表单提交-->
            <form class="layui-form" url="{:url('admin/api/muban',array('id'=>input('id')))}" t_url="javascript:;">
                <div class="layui-tab">
                    <ul class="layui-tab-title">
                        <li class="layui-this">基本设置</li>
                        <li>文章模板配置</li>
                        {volist name=":fun_s('model',array(),'id desc',1000,1)" id="vo"}
                        {if config_m(muban(),'model')||config_m(muban(),'model_soso')||config_m(muban(),'index_cate_m')||config_m(muban(),'index_html_m')}
                        <li>{$vo.title}</li>
                        {/if}
                        {/volist}
                        {if config_m(input('id'),'url')}
                        <li onclick="x_admin_show('扩展设置','{:config_m(input('id'),'url')}')">扩展设置</li>
                        {/if}
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show layui-row">
                            <!--配置开始-->
                            {foreach name=":config_m(input('id'),'config')" item="v" key="k"}
                            <div class="layui-col-md{:dingyi($v.md,12)}">
                                <div class="layui-form-item">
                                <label class="layui-form-label">
                                    {if $v.type}
                                    {$v.title}<input type="text" class="addonsfuzhi" value=" &#123;:cms('{$k}')&#125;">
                                    {else/}
                                    <blockquote>{$v.title}</blockquote>
                                    {/if}
                                </label>
                                    <div class="layui-input-block">
                                        {if $v.type=='单选框'}
                                        {foreach name="$v.options" item="opv" key="opk"}
                                        <input type="radio" name="{$k}" value="{$opk}" title="{$opv}" {if $opk == cms($k)}checked=""{/if}>
                                        {/foreach}
                                        {/if}
                                        {if $v.type=='选择框'}
                                        <select name="{$k}" lay-verify="{$v.required}">
                                            <option value=""></option>
                                            {foreach name="$v.options" item="opv" key="opk"}
                                            <option value="{$opk}" {if $opk == cms($k)}selected="selected"{/if}>{$opv}</option>
                                            {/foreach}
                                        </select>
                                        {/if}
                                        {if $v.type=='输入框'}
                                        <input type="text" name="{$k}" value="{:dingyi(cms($k),$v.value)}" placeholder="请输入内容" required  lay-verify="{$v.required}" autocomplete="off" class="layui-input">
                                        {/if}
                                        {if $v.type=='密码框'}
                                        <input type="password" name="{$k}" value="{:dingyi(cms($k),$v.value)}" required  lay-verify="{$v.required}" autocomplete="off" class="layui-input">
                                        {/if}
                                        {if $v.type=='文本域'}
                                        <textarea name="{$k}" rows="{$v.rows}" placeholder="请输入内容" class="layui-textarea">{:dingyi(cms($k),$v.value)}</textarea>
                                        {/if}
                                        {if $v.type=='附件'}
                                        <input type="text" name="{$k}" id="{$k}" value="{:dingyi(cms($k),$v.value)}" required  lay-verify="{$v.required}" placeholder="可直接填写地址" autocomplete="off" class="layui-input">
                                        <button type="button" class="layui-btn layui-btn-normal s{$k} upfujian">上传</button>
                                        <script type="text/javascript">
                                          layui.use(['form', 'upload', 'jquery']
                                          ,function(){
                                              var form = layui.form,
                                              upload = layui.upload,
                                              jq = layui.jquery;
                                              upload.render({
                                              elem: '.s{$k}',
                                              url: "{:url("admin/up/up")}",
                                              accept: 'file',
                                              done: function(res) {
                                                  if (res.code == '1') {
                                                    jq('#{$k}').val(res.path);
                                                    return layer.msg(res.msg);
                                                  } else {
                                                    return layer.msg(res.msg);
                                                  }
                                              }
                                            });
                                          });
                                          </script>
                                        {/if}
                                        <!--1.01新增-->
                                        {if $v.type=='颜色'}
                                        <input type="color" name="{$k}" value="{:dingyi(cms($k),$v.value)}" placeholder="请选择颜色" class="layui-input" id="form-input{$k}">
                                        {/if}
                                        {if $v.type=='时间'}
                                        <input type="date" name="{$k}" value="{:dingyi(cms($k),$v.value)}" placeholder="请选择时间" class="layui-input" id="form-input{$k}">
                                        {/if}
                                    </div>
                                </div>
                            </div>
                            {/foreach}
                            <!--配置end-->
                        </div>
                        <!--模板配置-->
                        <div class="layui-tab-item">
                            <fieldset class="layui-elem-field layui-field-title layui-row">
                                <legend>列表自定义模板</legend>
                                {volist name=":fun_s('cate',array('tid'=>0),'px desc',100,1)" id="vo"}
                                <div class="layui-col-md4">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label" {if $vo.tid==0}style="color: #0dc316;"{/if}>{$vo.name} [ID {$vo.id}]</label>
                                        <div class="layui-input-block">
                                            <select name="{$vo.alias}">
                                                <option value="">默认</option>
                                                {volist name=":guoji_vo(config_m(muban(),'index_cate'))" id="v"}
                                                <option value="{$v.id}" {if $v.id==cms($vo.alias)}selected="selected"{/if}>{$v.name}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                {volist name=":fun_s('cate',array('tid'=>$vo.id),'px desc',100,1)" id="vs"}
                                <div class="layui-col-md4">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">{$vs.name} [ID {$vs.id}]</label>
                                        <div class="layui-input-block">
                                            <select name="{$vs.alias}">
                                                <option value="">默认</option>
                                                {volist name=":guoji_vo(config_m(muban(),'index_cate'))" id="vk"}
                                                <option value="{$vk.id}" {if $vk.id==cms($vs.alias)}selected="selected"{/if}>{$vk.name}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                {/volist} 
                                {/volist}  
                            </fieldset>
                            <div style="padding: 10px; margin-top: 10px;background-color: #f6f6f6; color: #FF5722;"> 
                              模板选择在当前模板下的config里面进行配置选择
                            </div>
                            <fieldset class="layui-elem-field layui-field-title layui-row">
                                <legend>内容自定义模板</legend>
                                {volist name=":fun_s('cate',array('tid'=>0),'px desc',100,1)" id="vo"}
                                <div class="layui-col-md4">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label" {if $vo.tid==0}style="color: #0dc316;"{/if}>{$vo.name} [ID {$vo.id}]</label>
                                        <div class="layui-input-block">
                                            <select name="{$vo.alias}html">
                                                <option value="">默认</option>
                                                {volist name=":guoji_vo(config_m(muban(),'index_html'))" id="v"}
                                                <option value="{$v.id}" {if $v.id==cms($vo.alias.'html')}selected="selected"{/if}>{$v.name}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                {volist name=":fun_s('cate',array('tid'=>$vo.id),'px desc',100,1)" id="vs"}
                                <div class="layui-col-md4">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">{$vs.name} [ID {$vs.id}]</label>
                                        <div class="layui-input-block">
                                            <select name="{$vs.alias}html">
                                                <option value="">默认</option>
                                                {volist name=":guoji_vo(config_m(muban(),'index_html'))" id="vk"}
                                                <option value="{$vk.id}" {if $vk.id==cms($vs.alias.'html')}selected="selected"{/if}>{$vk.name}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                {/volist}
                                {/volist} 
                            </fieldset>
                            <div style="padding: 10px; margin-top: 10px;background-color: #f6f6f6; color: #FF5722;margin-bottom: 50px;"> 
                              默认的文章栏目模板配置
                            </div>
                        </div>
                        
                        <!--模型配置-->
                        {volist name=":fun_s('model',array(),'id desc',1000,1)" id="vp"}
                        {if config_m(muban(),'model')||config_m(muban(),'model_soso')||config_m(muban(),'index_cate_m')||config_m(muban(),'index_html_m')}
                        <div class="layui-tab-item">
                            <div class="layui-form-item">
                                <div class="layui-col-md4">
                                    <label class="layui-form-label"><a target="_blank" href="{:url('index/model/index',array('model'=>$vp.name))}">{$vp.title}首页</a></label>
                                    <div class="layui-input-block">
                                        <select name="{$vp.name}_model">
                                            <option value="">默认</option>
                                            {volist name=":guoji_vo(config_m(muban(),'model'))" id="v"}
                                            <option value="{$v.id}" {if $v.id==cms($vp.name.'_model')}selected="selected"{/if}>{$v.name}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-col-md4">
                                    <label class="layui-form-label"><a target="_blank" href="{:url('index/model/index',array('model'=>$vp.name))}">{$vp.title}搜索模板</a></label>
                                    <div class="layui-input-block">
                                        <select name="{$vp.name}_soso">
                                            <option value="">默认</option>
                                            {volist name=":guoji_vo(config_m(muban(),'model_soso'))" id="v"}
                                            <option value="{$v.id}" {if $v.id==cms($vp.name.'_soso')}selected="selected"{/if}>{$v.name}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <fieldset class="layui-elem-field layui-field-title layui-row">
                                <legend>列表自定义模板</legend>
                                {volist name=":fun_s('cate_m',array('tid'=>0,'m'=>$vp.name),'px desc',100,1)" id="vo"}
                                <div class="layui-col-md4">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label" {if $vo.tid==0}style="color: #0dc316;"{/if}>{$vo.name} [ID {$vo.id}]</label>
                                        <div class="layui-input-block">
                                            <select name="{$vo.alias}_{$vp.name}">
                                                <option value="">默认</option>
                                                {volist name=":guoji_vo(config_m(muban(),'index_cate_m'))" id="v"}
                                                <option value="{$v.id}" {if $v.id==cms($vo.alias.'_'.$vp.name)}selected="selected"{/if}>{$v.name}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                {volist name=":fun_s('cate_m',array('tid'=>$vo.id,'m'=>$vp.name),'px desc',100,1)" id="vs"}
                                <div class="layui-col-md4">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">{$vs.name} [ID {$vs.id}]</label>
                                        <div class="layui-input-block">
                                            <select name="{$vs.alias}_{$vp.name}">
                                                <option value="">默认</option>
                                                {volist name=":guoji_vo(config_m(muban(),'index_cate_m'))" id="vk"}
                                                <option value="{$vk.id}" {if $vk.id==cms($vs.alias.'_'.$vp.name)}selected="selected"{/if}>{$vk.name}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                {/volist} 
                                {/volist}  
                            </fieldset>
                            <div style="padding: 10px; margin-top: 10px;background-color: #f6f6f6; color: #FF5722;"> 
                              模板选择在当前模板下的config里面进行配置选择
                            </div>
                            <fieldset class="layui-elem-field layui-field-title layui-row">
                                <legend>内容自定义模板</legend>
                                {volist name=":fun_s('cate_m',array('tid'=>0,'m'=>$vp.name),'px desc',100,1)" id="vo"}
                                <div class="layui-col-md4">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label" {if $vo.tid==0}style="color: #0dc316;"{/if}>{$vo.name} [ID {$vo.id}]</label>
                                        <div class="layui-input-block">
                                            <select name="{$vo.alias}html_{$vp.name}">
                                                <option value="">默认</option>
                                                {volist name=":guoji_vo(config_m(muban(),'index_html_m'))" id="v"}
                                                <option value="{$v.id}" {if $v.id==cms($vo.alias.'html_'.$vp.name)}selected="selected"{/if}>{$v.name}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                {volist name=":fun_s('cate_m',array('tid'=>$vo.id,'m'=>$vp.name),'px desc',100,1)" id="vs"}
                                <div class="layui-col-md4">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">{$vs.name} [ID {$vs.id}]</label>
                                        <div class="layui-input-block">
                                            <select name="{$vs.alias}html_{$vp.name}">
                                                <option value="">默认</option>
                                                {volist name=":guoji_vo(config_m(muban(),'index_html_m'))" id="vk"}
                                                <option value="{$vk.id}" {if $vk.id==cms($vs.alias.'html_'.$vp.name)}selected="selected"{/if}>{$vk.name}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                {/volist}
                                {/volist} 
                            </fieldset>
                            <div style="margin-bottom: 500px;"></div>
                        </div>
                        {/if}
                        {/volist}
                    </div>
                </div> 
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" lay-filter="cms">立即提交</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{include file="app/admin/view/footer.html"}